<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/WEB-INF/templates/default.xhtml">

	<ui:define name="menu">
		<ul>
			<li><h:link value="Home"  outcome="/index" /> </li>
			<li><h:link value="Users"  outcome="/content/user/list" /> </li>
			<li><h:link value="Resources"  outcome="/content/resource/list" /> </li>
		    <li><h:link class="akt" value="Tasks"  outcome="/content/task/list" /> </li> 
		    <li><h:link value="Task types"  outcome="/content/tasktype/list" /> </li>		    
		</ul>
		<p class="vonal"><br/></p>
	</ui:define>

	<ui:define name="content2">		
		<h:form id="taskListForm">
			<h:button value="Task types"
				class="btnCommand"
				outcome="/content/tasktype/list" />

			<h:button value="Create new task"
				class="btnCommand"
				outcome="/content/task/edit" />

			<h:button value="Tasks by type"
				class="btnCommand"
				outcome="/content/task/listbytype" />

			<h:button value="Tasks by user"
				class="btnCommand"
				outcome="/content/task/listbyuser" />			

			<br/><br/>

			<h:dataTable id="taskTable"
				value="#{taskListBean.tasks}" var="task"
				styleClass="taskTable" columnClasses="taskTableName, taskTableEstimated, taskTableRemaining, taskTableCompleted, taskTableType, taskTableUserName, taskTableFulfill"
				rowClasses="userTableOddRow, userTableEvenRow">

				<h:column headerClass="taskTableHeaderName">
					<f:facet name="header">Name</f:facet>
					<h:link outcome="/content/task/edit" value="##{task.id}:  #{task.name}">
						<f:param name="id" value="#{task.id}" />
					</h:link>
				</h:column>

				<h:column headerClass="taskTableHeaderEstimated">
					<f:facet name="header">Estimated</f:facet>
					<h:outputText value="#{task.estimated}" />
				</h:column>

				<h:column headerClass="taskTableHeaderRemaining">
					<f:facet name="header">Remaining</f:facet>
					<h:outputText value="#{task.remaining}" />
				</h:column>

				<h:column headerClass="taskTableHeaderCompleted">
					<f:facet name="header">Completed</f:facet>
					<h:outputText value="#{task.completed}" />
				</h:column>

				<h:column headerClass="taskTableHeaderType">
					<f:facet name="header">Type</f:facet>
					<h:outputText value="#{task.taskType.name}" />
				</h:column>
			
				<h:column headerClass="taskTableHeaderUserName">
					<f:facet name="header">User</f:facet>
					<h:outputText value="#{task.user.name}" />
				</h:column>
				
				<h:column headerClass="taskTableHeaderResourceName">
					<f:facet name="header">Resource</f:facet>
					<h:outputText value="#{task.resource.name}" />
				</h:column>				
			
				<h:column headerClass="taskTableHeaderFulfill">
					<f:facet name="header">Complete</f:facet>
					<h:outputText value="#{task.fulfill}" />
				</h:column>	
			
			</h:dataTable>
			<br />
		</h:form>
	</ui:define>
</ui:composition>
